package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.ChatCategoryMapper;
import com.brainhealth.customer.domain.ChatCategory;
import com.brainhealth.customer.service.IChatCategoryService;

/**
 * 青竹聊天类型Service业务层处理
 * 
 * @author wolong
 * @date 2023-05-18
 */
@Service
public class ChatCategoryServiceImpl implements IChatCategoryService 
{
    @Autowired
    private ChatCategoryMapper chatCategoryMapper;

    /**
     * 查询青竹聊天类型
     * 
     * @param id 青竹聊天类型主键
     * @return 青竹聊天类型
     */
    @Override
    public ChatCategory selectChatCategoryById(Long id)
    {
        return chatCategoryMapper.selectChatCategoryById(id);
    }

    /**
     * 查询青竹聊天类型列表
     * 
     * @param chatCategory 青竹聊天类型
     * @return 青竹聊天类型
     */
    @Override
    public List<ChatCategory> selectChatCategoryList(ChatCategory chatCategory)
    {
        return chatCategoryMapper.selectChatCategoryList(chatCategory);
    }

    /**
     * 新增青竹聊天类型
     * 
     * @param chatCategory 青竹聊天类型
     * @return 结果
     */
    @Override
    public int insertChatCategory(ChatCategory chatCategory)
    {
        chatCategory.setCreateTime(DateUtils.getNowDate());
        return chatCategoryMapper.insertChatCategory(chatCategory);
    }

    /**
     * 修改青竹聊天类型
     * 
     * @param chatCategory 青竹聊天类型
     * @return 结果
     */
    @Override
    public int updateChatCategory(ChatCategory chatCategory)
    {
        chatCategory.setUpdateTime(DateUtils.getNowDate());
        return chatCategoryMapper.updateChatCategory(chatCategory);
    }

    /**
     * 批量删除青竹聊天类型
     * 
     * @param ids 需要删除的青竹聊天类型主键
     * @return 结果
     */
    @Override
    public int deleteChatCategoryByIds(Long[] ids)
    {
        return chatCategoryMapper.deleteChatCategoryByIds(ids);
    }

    /**
     * 删除青竹聊天类型信息
     * 
     * @param id 青竹聊天类型主键
     * @return 结果
     */
    @Override
    public int deleteChatCategoryById(Long id)
    {
        return chatCategoryMapper.deleteChatCategoryById(id);
    }
}
